using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MAPDavy.Entities;

namespace MAPDavy.Repository.Mapping
{
	public class TutorMap : EntityTypeConfiguration<Tutor>
	{
		public TutorMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.Id)
				.IsRequired()
				.IsFixedLength()
				.HasMaxLength(5);
				
			this.Property(t => t.LastName)
				.IsRequired()
				.HasMaxLength(250);
				
			this.Property(t => t.FirtsName)
				.IsRequired()
				.HasMaxLength(250);
				
			// Table & Column Mappings
			this.ToTable("Tutor");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.LastName).HasColumnName("LastName");
			this.Property(t => t.FirtsName).HasColumnName("FirtsName");
			this.Property(t => t.Activo).HasColumnName("Activo");
		}
	}
}

